<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <div th:replace="header::common"></div>
</head>
<body>
    <form action="/user/update" method="post">
        <input type="hidden" name="id" th:value="${user.id}">
        <div class="form-group">
            <label for="username">用户名</label>
            <input type="text" th:value="${user.username}" class="form-control" name="username" id="username">
        </div>
        <div class="form-group">
            <label for="password">密码</label>
            <input type="text" th:value="${user.password}" class="form-control" name="password" id="password">
        </div>
        <div class="form-group">
            <label for="email">邮箱</label>
            <input type="email" th:value="${user.email}" class="form-control" name="email" id="email">
        </div>
        <div class="form-group">
            <label for="phone">电话</label>
            <input type="phone" th:value="${user.phone}" class="form-control" name="phone" id="phone">
        </div>
        <div class="form-group">
            <label>角色</label>
            <input type="radio" th:checked="${user.role==0}" name="role" value="0"/>管理员
            <input type="radio" th:checked="${user.role==1}" name="role" value="1"/>普通用户
        </div>
        <div class="form-group">
            <label>部门</label>
            <select name="deptId" class="form-control">
                <option th:each="dept:${list}" th:selected="${dept.id==user.deptId}" th:value="${dept.id}" th:text="${dept.name}"></option>
            </select>
        </div>
        <input class="btn btn-primary" type="submit" value="编辑"/>
    </form>
</body>
</html>